package cn.mymall.constant;


import cn.mymall.config.SpringContextUtil;

public class CachedKey {

	public static final String CHANNEL_ORDER_TEST_ = "channel_order_test_";

	public static final String CHANNEL_ORDER_PROD_ = "channel_order_prod";

	public static final String WAIT_PROCESS_ORDER = "wait_process_order";

	public static final String WAIT_PROCESS_MC_ORDER = "wait_process_mc_order";

	public static final String MOVIE_LOCK_SEAT_SWITCH_PROD = "movie_lock_seat_switch_prod";

	public static final String MOVIE_LOCK_SEAT_SWITCH_TEST = "movie_lock_seat_switch_test";

	public static final String MOVIE_ORDER_NOTE_PROD = "movie_order_note_prod";

	public static final String MOVIE_ORDER_NOTE_TEST = "movie_order_note";

	public static final String MEMBER_APPLY_REFUND_CFG_PROD = "member_apply_refund_cfg_prod";

	public static final String MEMBER_APPLY_REFUND_CFG_TEST = "member_apply_refund_cfg_test";


	public static String getJoinKey(String key,   Object... params){
		if(params==null){
			return key;
		}
		StringBuilder sb = new StringBuilder(key);
		for(Object p : params){
			sb.append("_").append(p);
		}
		return sb.toString();
	}

	public static String getMovieChannel(){
		if(SpringContextUtil.isProdEnv()){
			return CHANNEL_ORDER_PROD_;
		}
		return CHANNEL_ORDER_TEST_;
	}

	public static String getMovieLockSeatSwitch(){
		if(SpringContextUtil.isProdEnv()){
			return MOVIE_LOCK_SEAT_SWITCH_PROD;
		}
		return MOVIE_LOCK_SEAT_SWITCH_TEST;
	}

	public static String getMovieOrderNote(){
		if(SpringContextUtil.isProdEnv()){
			return MOVIE_ORDER_NOTE_PROD;
		}
		return MOVIE_ORDER_NOTE_TEST;
	}

	public static String getMemberApplyRefundCfg(){
		if(SpringContextUtil.isProdEnv()){
			return MEMBER_APPLY_REFUND_CFG_PROD;
		}
		return MEMBER_APPLY_REFUND_CFG_TEST;
	}


}
